/**
 * Created by Administrator on 2017/3/23 0023.
 */
var Page10={
    create:function () {
        var page={};

        page.ui=new PIXI.DisplayObjectContainer();

        var bg=new PIXI.Graphics();
        bg.beginFill(0x0,1);
        bg.drawRect(0,0,pixiStageW,pixiStageH);
        bg.endFill();
        page.ui.addChild(bg);

        var bgImg=new PIXI.Sprite(resource['assets/images/p10_bg.png'].texture);
        bgImg.anchor.set(0);
        bgImg.x=0;
        bgImg.y=50;
        page.ui.addChild(bgImg);

        var logo=new PIXI.Sprite(resource['assets/images/p10_logo.png'].texture);
        logo.anchor.set(0);
        logo.x=20;
        logo.y=70;
        page.ui.addChild(logo);

        var logo1=new PIXI.Sprite(resource['assets/images/p10_logo2.png'].texture);
        logo1.anchor.set(0.5);
        logo1.x=1054;
        logo1.y=106;
        page.ui.addChild(logo1);

        // var circle1=new PIXI.Sprite(resource['assets/images/p8_circle.png'].texture);
        // circle1.anchor.set(0.5);
        // circle1.x=740;
        // circle1.y=322;
        // page.ui.addChild(circle1);
        // TweenMax.to(circle1,15,{rotation:-Math.PI*2,ease:Linear.easeNone,repeat:-1});
        //
        // var flower=new  PIXI.Sprite(resource['assets/images/p8_flower.png'].texture);
        // flower.anchor.set(0.5);
        // flower.x=556;
        // flower.y=359;
        // page.ui.addChild(flower);

        var t0=new PIXI.Sprite(resource['assets/images/p10_t0.png'].texture);
        t0.anchor.set(0.5);
        t0.x=827;
        t0.y=198;
        page.ui.addChild(t0);

        var t1=new PIXI.Sprite(resource['assets/images/p10_t1.png'].texture);
        t1.anchor.set(0.5);
        t1.x=850;
        t1.y=380;
        page.ui.addChild(t1);

        var line=new PIXI.Sprite(resource['assets/images/p10_line.png'].texture);
        line.anchor.set(0);
        line.x=718;
        line.y=464;
        page.ui.addChild(line);

        var t2=new PIXI.Sprite(resource['assets/images/p10_tt2.png'].texture);
        // t2.anchor.set(0.5);
        t2.x=534;
        t2.y=464;
        page.ui.addChild(t2);

        var mask2=new PIXI.Graphics();
        mask2.beginFill(0x0,1);
        mask2.drawRect(0,0,435,53);
        mask2.endFill();
        mask2.x=282;
        mask2.y=451;
        page.ui.addChild(mask2);
        t2.mask=mask2;

        var t3=new PIXI.Sprite(resource['assets/images/p10_tt3.png'].texture);
        // t3.anchor.set(0.5);
        t3.x=728;
        t3.y=465;
        page.ui.addChild(t3);

        var mask3=new PIXI.Graphics();
        mask3.beginFill(0x0,1);
        mask3.drawRect(0,0,435,53);
        mask3.endFill();
        mask3.x=719;
        mask3.y=450;
        page.ui.addChild(mask3);
        t3.mask=mask3;

        var t4=new PIXI.Sprite(resource['assets/images/p10_t4.png'].texture);
        t4.anchor.set(0.5);
        t4.x=788;
        t4.y=538;
        page.ui.addChild(t4);

        
        page.In=function () {
            bg.alpha=0;
            TweenMax.to(bg,1.5,{delay:0,alpha:1});

            bgImg.alpha=0;
            TweenMax.to(bgImg,1,{delay:1,alpha:1});



            t0.scale.x=t0.scale.y=0;
            TweenMax.to(t0.scale,1.2,{delay:2,x:1,y:1,ease:Back.easeOut});
            t1.scale.x=t1.scale.y=0;
            TweenMax.to(t1.scale,1.2,{delay:2.5,x:1,y:1,ease:Back.easeOut});

            line.alpha=0;
            TweenMax.to(line,1.2,{delay:2.5,alpha:0.7,ease:Cubic.easeInOut});

            t2.x=725;
            t2.alpha=0.5;
            TweenMax.to(t2,2,{delay:3,x:534,alpha:1,ease:Cubic.easeInOut});
            t3.x=367;
            t3.alpha=0.5;
            TweenMax.to(t3,2,{delay:3,x:730,alpha:1,ease:Cubic.easeInOut});

            t4.scale.x=t4.scale.y=0;
            TweenMax.to(t4.scale,1,{delay:4.5,x:1,y:1,ease:Back.easeOut});

            logo.x=20-50
            logo.alpha=0;
            TweenMax.to(logo,1,{delay:5,alpha:1,x:20,ease:Back.easeOut});

            logo1.x=1054+50;
            logo1.alpha=0;
            TweenMax.to(logo1,1,{delay:5.5,alpha:1,x:1054,ease:Back.easeOut});
            
            setTimeout(function () {
                var event = new CustomEvent("Game_PageIn",{'detail':11});
                document.dispatchEvent(event);
            },10000);
        }

        return page;
    }
}